﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RepositoryEntity
{
    /// <summary>
    /// 数据库上下文
    /// </summary>
    public class RepositoryDbContext : DbContext
    {
        public RepositoryDbContext(DbContextOptions<RepositoryDbContext> options) : base(options)
        {
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
        }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            //配置连接字符串
            //optionsBuilder.UseSqlServer(@"Server=.;Database=Test;Trusted_Connection=True;");

            //打印ef执行sql
            //optionsBuilder.LogTo(Console.WriteLine);
        }

        public DbSet<UserInfo> UserInfo { get; set; }
        public DbSet<RoleInfo> RoleInfo { get; set; }
        public DbSet<DepartmentInfo> DepartmentInfo { get; set; }
        public DbSet<R_UserInfo_RoleInfo> R_UserInfo_RoleInfo { get; set; }
        public DbSet<MenuInfo> MenuInfo { get; set; }
        public DbSet<R_UserInfo_MenuInfo> R_UserInfo_MenuInfo { get; set; }
        public DbSet<ConsumableInfo> ConsumableInfo { get; set; }
        public DbSet<Category> Category { get; set; }
        public DbSet<ConsumableRecord> ConsumableRecord { get; set; }
        public DbSet<WorkFlow_Model> WorkFlow_Model { get; set; }
        public DbSet<WorkFlow_Instance> WorkFlow_Instance { get; set; }
        public DbSet<WorkFlow_InstanceStep> WorkFlow_InstanceStep { get; set; }

    }
}
